val people = List(("男", "李四"),("男", "张三"),("女", "陈思思"),("女", "马冬梅"),("男", "王五"))
val rdd = sc.parallelize(people, 2)
val result = rdd.combineByKey(
(x: String) => (List(x), 1),
(peo: (List[String], Int), x: String) => (x :: peo._1, peo._2 + 1),
(sex1: (List[String], Int), sex2: (List[String], Int)) => (sex1._1 ::: sex2._1, 
sex1._2 + sex2._2))
result.foreach(println)